package com.hoshiicloud.goods.mapper.goods;

import com.hoshiicloud.common.utils.tree.GoodsCategoryWithGoodNumTree;
import com.hoshiicloud.goods.entity.goods.GoodsCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hoshiicloud.common.utils.tree.Menu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品类目表 Mapper 接口
 * </p>
 *
 * @author zhangshuhu
 * @since 2019-06-04
 */
public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory> {

    /**
     *  查询所有类目信息
     */
    List<Menu> getCategorys(@Param("companyId") Long companyId);

    Long getMaxCodeByCompanyIdAndParentId(@Param("companyId") Long companyId,@Param("parentId") Long parentId);

    List<Menu> getCategorys3(@Param("companyId") Long companyId);

    List<GoodsCategoryWithGoodNumTree> listGoodsCategoryWithGoodsNums(@Param("companyId") Long companyId);

    Integer updateStatusChildren(@Param("gc") GoodsCategory gc);

    List<GoodsCategory> selectChildrenChildren(@Param("gc") GoodsCategory gc);

    /**
     * 查询类目内容
     *
     * @param categoryContextQueryStr String
     * @return String
     */
    String selectcategoryContext(@Param("categoryContextQueryStr") String categoryContextQueryStr);
}
